import request from '@/utils/request.js'

export const getArticles = (obj) => {
  return request.get('/h5/interview/query', {
    params: {
      current: obj.current || 1,
      pageSize: obj.pageSize || 10,
      sorter: obj.sorter || null
    }
  })
}

export const getDetail = id => {
  return request.get('/h5/interview/show', { params: { id: id } })
}

export const updateLike = (id) => {
  return request.post('/h5/interview/opt', {
    id,
    optType: 1 // 喜欢
  })
}

export const updateCollect = (id) => {
  return request.post('/h5/interview/opt', {
    id,
    optType: 2 // 收藏
  })
}
